Skip to content

fix: APIAPEX-2747 add follow flag to instance logs#77

Merged
gorkarevilla merged 2 commits into
mainfrom
feat/logs_not_follow
Apr 16, 2026
Merged

fix: APIAPEX-2747 add follow flag to instance logs#77
gorkarevilla merged 2 commits into
mainfrom
feat/logs_not_follow

Conversation

@gorkarevilla

@gorkarevilla gorkarevilla commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

By default instance logs always follow the logs. This is a problem for AIs and automated tools, because to stop the logs you need to Interrupt the command. This changes the default behaviour, now it will print the last logs and you can follow by using the -f or --follow flag.

Before:

vcr instance logs --id be7de51e-8209-4ec8-a2d8-9e17bd96015b

2026-04-13T10:32:30+02:00 [application] 2026/04/13 08:32:30 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:33:06+02:00 [application] 2026/04/13 08:33:06 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:17+02:00 [application] 2026/04/13 08:33:17 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:36:15+02:00 [application] 2026/04/13 08:36:15 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:36:18+02:00 [application] 2026/04/13 08:36:18 vonage SMS rejected: Bad Credentials



^CInterrupt received, stopping...

After:

./vcr_macos_arm64  instance logs --id be7de51e-8209-4ec8-a2d8-9e17bd96015b

2026-04-13T10:32:30+02:00 [application] 2026/04/13 08:32:30 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:33:06+02:00 [application] 2026/04/13 08:33:06 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:17+02:00 [application] 2026/04/13 08:33:17 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:36:15+02:00 [application] 2026/04/13 08:36:15 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:36:18+02:00 [application] 2026/04/13 08:36:18 vonage SMS rejected: Bad Credentials

---

./vcr_macos_arm64 instance logs --id be7de51e-8209-4ec8-a2d8-9e17bd96015b -f

2026-04-13T10:32:30+02:00 [application] 2026/04/13 08:32:30 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:33:06+02:00 [application] 2026/04/13 08:33:06 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:07+02:00 [application] 2026/04/13 08:33:07 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:17+02:00 [application] 2026/04/13 08:33:17 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:33:18+02:00 [application] 2026/04/13 08:33:18 vonage SMS rejected: Bad Credentials
2026-04-13T10:36:15+02:00 [application] 2026/04/13 08:36:15 SMS Dashboard listening on 0.0.0.0:8080
2026-04-13T10:36:18+02:00 [application] 2026/04/13 08:36:18 vonage SMS rejected: Bad Credentials
^CInterrupt received, stopping...

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the vcr instance log command to support a new --follow/-f flag so users can choose between fetching a fixed set of historical logs (default) or continuously streaming new log entries.

Changes:

  • Add --follow/-f flag and update command help text/examples to reflect default “fetch and exit” behavior.
  • Update runLog logic to perform a one-shot fetch when --follow is not set.
  • Update unit tests and generated docs for the new flag and behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
vcr/instance/log/log.go Adds Follow option/flag and switches default behavior to fetch once unless --follow is provided.
vcr/instance/log/log_test.go Extends tests for the new default behavior and datastore calls; adjusts assertions.
docs/vcr_instance_log.md Updates command docs, examples, and options to include --follow.

Comment thread vcr/instance/log/log.go
Comment thread vcr/instance/log/log.go
Comment thread vcr/instance/log/log_test.go

@sichan-vonage sichan-vonage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gorkarevilla gorkarevilla merged commit 5945724 into main Apr 16, 2026
9 checks passed
@gorkarevilla gorkarevilla deleted the feat/logs_not_follow branch April 16, 2026 06:42
gorkarevilla added a commit that referenced this pull request May 11, 2026
* fix: APIAPEX-2747 add follow flag to instance logs

* test: add tests
gorkarevilla added a commit that referenced this pull request May 13, 2026
* feat: add secret list command

* feat(debug): add prune-sessions command (#76)

* chore(main): release 2.4.0 (#78)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: APIAPEX-2747 add follow flag to instance logs (#77)

* fix: APIAPEX-2747 add follow flag to instance logs

* test: add tests

* chore: add skills and agents.md

* fix(secrets): fix example output, test exec error assertion, and nil-safe traceID

* fix(secrets): extract n/a trace ID fallback into constant to satisfy goconst

---------

Co-authored-by: Simon Chan <85551662+sichan-vonage@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants